clf

x0=0
x1=3

%a1 = x0:(x1-x0)/10:x1;


%for a1=.4
%g=1.5
lw=3;
fs=24;
d=x1/1000;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
hold on
c1 = 2*(2-sqrt(2));
c2 = 2;

ylim([0,1])
%g = xvals(x0,c1);
ga = x0:d:c1;
a1a = (-4 - ga + sqrt(16*ga+ga.^2))./(-4+2*ga);

a3a = ones(size(ga));



%g = xvals(c1,c2);
gb = c1:d:c2;
a1b = (2*(2 - 2*gb + sqrt(-gb.^2 + gb.^3)))./(4 - 4*gb + gb.^2);

a3b = (-6*gb.^2 + 4*sqrt((-1 + gb).*(gb.^2)) + 2*gb.*(2 + sqrt((-1 + gb).*(gb.^2))))./(((-2 + gb).^2).*(-gb + sqrt((-1 + gb).*(gb.^2))));



%plot([c1 c1], [0  1]);
%plot([c2 c2], [0  1]);
%[g' a1a' a3a' a1b' a3b']

%g = xvals(2,x1);
gc = 2:d:x1;
a3c = (-6 - gc + sqrt(-28 + 44*gc + gc.^2))./(4*(-2 + gc));



g = [ga gb gc]
ii = round(linspace(1,numel(g),20))
y = [a1a a1b a3c];
plot(g, y, 'k--','LineWidth', lw)
y = [a3a-a1a a3b-a1b zeros(size(gc))];
plot(g, y, 'k:','LineWidth', lw)
y=[1-a3a 1-a3b 1-a3c];
plot(g, y, 'k-','LineWidth', lw)

xlabel('\gamma', 'FontSize', fs);
%ylabel('f', 'FontSize', fs);
set(gca,'FontSize',fs);


%text(.84*x1, .06, 'f(0,1)+f(1,0)', 'FontSize', fs)  
%text(.93*x1, .375, 'f(0,0)', 'FontSize', fs)  
%text(.93*x1, .63, 'f(1,1)', 'FontSize', fs)  
%fs=16
%text(c1/2 -.3, .95, 'B'' = \{(0,0) (1,0)\}', 'FontSize', fs)  
%text(c1 + (c2-c1)/2 -.41, .95, '\{(0,0) (1,0) (1,1)\}', 'FontSize', fs)  
%text(c2 + (x1-c2)/2 -.3, .95, 'B'' = \{(0,0) (1,1)\}', 'FontSize', fs)  
legend('h(0,0)', 'h(0,1)+h(1,0)', 'h(1,1)')
box on

%name = '../google/papers/graphs/eq';
name = 'C:\Users\me\Documents\synch\southampton\auctions\google\results\GRAPHS\analytical'
print('-depsc',strcat(name, '.eps'));
print('-dpdf',strcat(name, '.pdf'));


